/**
 * Created  zhj 2015-12-1
 */
package com.sunnada.edu.system.pub.common;

import org.apache.commons.codec.binary.Base64;

public class Base64Tool{

	 // 加密  
    public static String encoded(String data) throws Exception {  
    	 byte[] b = Base64.encodeBase64(data.getBytes("UTF-8"));  
         return new String(b, "UTF-8");  
    }  
    // 解密  
    public  static String decode(String data) throws Exception {  
        byte[] b = Base64.decodeBase64(data.getBytes("UTF-8"));  
        return new String(b, "UTF-8");  
    }  
	
	public static void main(String[]args) throws Exception{
	 
	}
	
}